{template '_header'}
<div class='fui-page  fui-page-current'>
    <div class="fui-header">
	<div class="fui-header-left">
	    <a class="back"></a>
	</div>
	<div class="title">预约核销</div>
	<div class="fui-header-right">&nbsp;</div>
    </div>
    <div class='fui-content navbar'>

	<div class='fui-list-group'>
	    <div class='fui-list order-status'>

		<div class='fui-list-inner'>
		    <div class='title'>{$order['ordersn']}</div>
		    <div class='text'>总价: ￥{$order['price']}</div>
			<div class='text'>订金: ￥{$order['dowpayment']} <span class="text-danger">({if $order['tradestatus'] >0}已付款{else}未支付{/if})</span></div>
		    <div class='text'>尾款: ￥{$order['betweenprice']} <span class="text-danger">({if $order['tradestatus'] == 2}已付款{else}未支付{/if})</span></div>
		</div>
	    </div>
	</div>

	{if !empty($carrier) ||!empty($store)}

	<div class='fui-list-group' style='margin-top:5px;'>

		<div  class="fui-list store-item" >
			<div class="fui-list-media">
				<i class='icon icon-box'></i>
			</div>
			<div class="fui-list-inner store-inner">

				<div class="title"> <span class='storename'>预约信息</span></div>

				<div class="text">
					<span class='address'>预约时间:{php echo date('Y-m-d',$goods['trade_time'])} {$goods['optime']}</span>
				</div>

				{if !empty($carrier['carrier_realname'])}
				<div class="text">
					<span class='realname'>姓名:{$carrier['carrier_realname']}</span>
				</div>
				{/if}


				{if !empty($carrier['carrier_mobile'])}
				<div class="text">
					<span class='address'>电话:{$carrier['carrier_mobile']}</span>
				</div>
				{/if}

				{if !empty($goods['peopleinfo'])}
				<div class="text">
					<span class='address'>预约{$temp_type[$tempinfo['type']]['trade']}:{$goods['peopleinfo']['nickname']}</span>
				</div>
				{/if}

				{if !empty($carrier['carrier_id'])}
				<div class="text">
					<span class='address'>身份证:{$carrier['carrier_id']}</span>
				</div>
				{/if}

				{if !empty($carrier['carrier_number'])}
				<div class="text">
					<span class='address'>预约人数:{$carrier['carrier_number']}</span>
				</div>
				{/if}

			</div>
		</div>

	    {if !empty($store)}
	    <div class='fui-list'>
		<div class='fui-list-media'><i class='icon icon-shop'></i></div>
		<div class='fui-list-inner'>
		    <div class='title'>{$store['storename']}</div>
		</div>
	    </div>
	    {/if}
	</div>
	{/if}

	<div class="fui-list-group goods-list-group">  

	    <div class="fui-list-group-title"><i class="icon icon-shop"></i> {$_W['shopset']['shop']['name']}</div>

	    {loop $allgoods $g}
	    <a href="{php echo mobileUrl('goods/detail',array('id'=>$g['goodsid']))}">

		<div class="fui-list goods-list">
		    <div class="fui-list-media">
			<img src="{php echo tomedia($g['thumb'])}" class="round">
		    </div>
		    <div class="fui-list-inner">
			<div class="text goodstitle">{$g['title']}</div> 
			{if !empty($g['optionid'])}<div class='subtitle'>{$g['optiontitle']}</div>{/if}

		    </div>
		    <div class='fui-list-angle'>
			￥<span class='marketprice'>{$g['price']}<br/>
		    </div>

		</div>
	    </a>
	    {/loop}
	</div>
{if $order['dispatchtype']}
<div class='fui-cell-group'>
	    <div class='fui-cell'>
		<div class='fui-cell-label'>提货码</div>
		<div class='fui-cell-info'></div>
		<div class='fui-cell-remark noremark'>{$order['verifycode']}</div>
	    </div>
	</div>
{else}
	{if $order['verifytype']==0}
	<div class='fui-cell-group'>
	    <div class='fui-cell'>
		<div class='fui-cell-label'>消费码</div>
		<div class='fui-cell-info'></div>
		<div class='fui-cell-remark noremark'>{$order['verifycode']}</div>
	    </div>
	</div>
	{elseif $order['verifytype']==1}

	<div class='fui-cell-group'>
	    <div class='fui-cell'>
		<div class='fui-cell-label' style='width:auto;'>使用次数 (剩余 <span class='text-danger'>{$lastverifys}</span> 次)</div>
		<div class='fui-cell-info'></div>
		<div class='fui-cell-remark noremark'>
		    <div class="fui-number" 
			 data-value='1'
			 data-max="{$lastverifys}" 
			 data-min="1">
			<div class="minus">-</div>
			<input class="num shownum" type="tel" name="" value="1"/>
			<div class="plus ">+</div>
		    </div>
		</div>
	    </div>
	</div>
	{else}

	<div class='fui-according-group {if count($verifyinfo)<=3}expanded{/if} verify-container' data-orderid="{$order['id']}" data-verifytype="{$order['verifytype']}">
	    <div class='fui-according expanded'>
		<div class='fui-according-header'>

		    <i class='icon icon-list'></i>	     
		    <span class="text">消费码</span>
		    <span class="remark"><div class="badge">{if  !empty($_GPC['verifycode'])}1{else}{$lastverifys}{/if}</div></span>
		</div>
		<div class="fui-according-content verifycode-container">

		    <div class='fui-cell-group'>
			{loop $verifyinfo $v}
			{if empty($_GPC['single']) || ( !empty($_GPC['single']) && $v['select'] ) }
			    <div class='fui-cell verify-cell' data-verifycode="{$v['verifycode']}">
				<div class='fui-cell-label' style='width:auto'>
				    {if !$v['verified']}
				    <input type='checkbox' class='fui fui-checkbox fui-checkbox-danger verify-checkbox' {if !empty($v['select'])}checked{/if} 
					   {if !empty($_GPC['single']) && $v['select']}style='display:none'{/if}
					   />
					   {/if}
					   {$v['verifycode']}
				</div>
				<div class='fui-cell-info'></div>
				<div class='fui-cell-remark noremark'>
				    {if $v['verified']}
				    <div class='fui-label fui-label-danger' >已使用</div>
				    {else}
				    <div class='fui-label fui-label-default' >未使用</div>
				    {/if}

				</div>
			    </div>
			 
			   {/if}
		 
			{/loop}
		    </div>


		</div>
	    </div>
	</div>
	{/if}
{/if}

    </div>
    <div class='fui-footer'>
	<div class="btn btn-danger order-verify block" data-orderid="{$order['id']}" data-verifytype="{$order['verifytype']}">
	    <i class="icon icon-check"></i> 
	    <span>确定使用</span>
	</div>

    </div>
    <script language='javascript'>require(['biz/plugin/newstore/verify/detail'], function (modal) {
                modal.init({php echo json_encode($createInfo)});
            });</script>
</div>
{template '_footer'}